home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / gcc-lib / i486-unknown-sco3.2v5.0.0elf / 2.6-95q2 / include / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-12  |  6.2 KB  |  231 lines

  1. /* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
  2.  
  3.  
  4. #if defined(_NO_PROTOTYPE)    /* Old, crufty environment */
  5. #include <oldstyle/stdlib.h>
  6. #elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS)    /* Xpg4 environment */
  7. #include <xpg4/stdlib.h>
  8. #elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
  9. #include <posix/stdlib.h>
  10. #elif _STRICT_ANSI     /* Pure Ansi/ISO environment */
  11. #include <ansi/stdlib.h>
  12. #elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
  13. #include <ods_30_compat/stdlib.h>
  14. #else     /* Normal, default environment */
  15. /*
  16.  *   Copyright (C) 1984-1995 The Santa Cruz Operation, Inc.
  17.  *        All Rights Reserved.
  18.  *
  19.  *    The information in this file is provided for the exclusive use of
  20.  *    the licensees of The Santa Cruz Operation, Inc.  Such users have the
  21.  *    right to use, modify, and incorporate this code into other products
  22.  *    for purposes authorized by the license agreement provided they include
  23.  *    this notice and the associated copyright notice with any such product.
  24.  *    The information in this file is provided "AS IS" without warranty.
  25.  */
  26.  
  27. /*    Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
  28. /*    Portions Copyright (c) 1979 - 1990 AT&T   */
  29. /*      All Rights Reserved   */
  30.  
  31. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF          */
  32. /*    UNIX System Laboratories, Inc.                          */
  33. /*    The copyright notice above does not evidence any        */
  34. /*    actual or intended publication of such source code.     */
  35.  
  36. #ifndef _STDLIB_H
  37. #define _STDLIB_H
  38.  
  39. #pragma comment(exestr, "xpg4plus @(#) stdlib.h 20.1 94/12/04 ")
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #pragma pack(4)
  46.  
  47. #ifndef _DIV_T
  48. #define _DIV_T
  49. typedef    struct
  50. {
  51.     int    quot;
  52.     int    rem;
  53. } div_t;
  54. #endif
  55.  
  56. #ifndef _LDIV_T
  57. #define _LDIV_T
  58. typedef struct
  59. {
  60.     long    quot;
  61.     long    rem;
  62. } ldiv_t;
  63. #endif
  64.  
  65. #ifndef _SIZE_T
  66. #define _SIZE_T
  67. typedef unsigned int    size_t;
  68. #endif
  69.  
  70. #if !defined(_SSIZE_T)
  71. #define _SSIZE_T
  72. typedef int    ssize_t;
  73. #endif
  74.  
  75. #ifndef _WCHAR_T
  76. #define _WCHAR_T
  77. typedef long    wchar_t;
  78. #endif
  79.  
  80. #ifndef NULL
  81. #define NULL    0
  82. #endif /* NULL */
  83.  
  84. #define EXIT_FAILURE    1
  85. #define EXIT_SUCCESS    0
  86. #define RAND_MAX    077777
  87.  
  88.  
  89. /* From sys/wait.h */
  90. #define WNOHANG          0001
  91. #define WUNTRACED   0002
  92. #define WEXITSTATUS(sv)  ((sv >> 8) & 0xff)
  93. #define WIFEXITED(sv)    ((sv & 0xff) == 0)
  94. #define WIFSIGNALED(sv)  ((sv) && (sv == (sv & 0x00ff)))
  95. #define WIFSTOPPED(sv)   ((sv & 0xff) == 0177)
  96. #define WSTOPSIG(sv)     ((sv >> 8) & 0xff)
  97. #define WTERMSIG(sv)     (sv & 0x7f)
  98.  
  99.  
  100. extern unsigned char    __ctype[];
  101.  
  102. #define MB_CUR_MAX    ((int)__ctype[520])
  103.  
  104. extern double    atof(const char *);
  105. extern int    atoi(const char *);
  106. extern long    atol(const char *);
  107. extern double    strtod(const char *, char **);
  108. extern float    strtof(const char *, char **);
  109. extern long    strtol(const char *, char **, int);
  110. extern unsigned long    strtoul(const char *, char **, int);
  111.  
  112. extern int    rand(void);
  113. extern void    srand(unsigned int);
  114.  
  115. extern void    *calloc(size_t, size_t);
  116. extern void    free(void *);
  117. extern void    *malloc(size_t);
  118. extern void    *realloc(void *, size_t);
  119.  
  120. extern void    abort(void);
  121. extern int    atexit(void (*)(void));
  122. extern void    exit(int);
  123. extern char    *getenv(const char *);
  124. extern int    system(const char *);
  125.  
  126. extern void    *bsearch(const void *, const void *, size_t, size_t,
  127.             int (*)(const void *, const void *));
  128. extern void    qsort(void *, size_t, size_t,
  129.             int (*)(const void *, const void *));
  130.  
  131. #ifdef __cplusplus
  132. #ifndef _ABS_INL
  133. #define _ABS_INL
  134. inline int (abs)(int i) {return (i > 0) ? i : -i;}
  135. #endif
  136. #else
  137. extern int    (abs)(int);    /* Protect from macro definitions */
  138. #endif
  139.  
  140. extern div_t    div(int, int);
  141. extern long    labs(long);
  142. extern ldiv_t    ldiv(long, long);
  143.  
  144. extern int    mbtowc(wchar_t *, const char *, size_t);
  145. extern int    mblen(const char *, size_t);
  146. extern int    wctomb(char *, wchar_t);
  147.  
  148. extern size_t    mbstowcs(wchar_t *, const char *, size_t);
  149. extern size_t    wcstombs(char *, const wchar_t *, size_t);
  150.  
  151.  
  152. extern long    a64l(const char *);
  153. extern int    dup2(int, int);
  154. extern char    *ecvt(double, int, int *, int *);
  155. extern char    *ecvtl(long double, int, int *, int *);
  156. extern char    *fcvt(double, int, int *, int *);
  157. extern char    *fcvtl(long double, int, int *, int *);
  158. extern char    *getcwd(char *, size_t);
  159. extern char    *getlogin(void);
  160. extern int    getopt(int, char *const *, const char *);
  161. extern int    getsubopt(char **, char *const *, char **);
  162. extern char    *initstate(unsigned, char *, int);
  163. extern int    grantpt(int);
  164. extern char    *optarg;
  165. extern int    optind, opterr, optopt;
  166. extern char    *getpass(const char *);
  167. extern int    getpw(int, char *);
  168. extern char    *gcvt(double, int, char *);
  169. extern char    *gcvtl(long double, int, char *);
  170. extern int    isatty(int);
  171. extern void    l3tol(long *, const char *, int);
  172. extern char    *l64a(long);
  173. extern char    *l64a_r(long, char *, size_t);
  174. extern void    ltol3(char *, const long *, int);
  175. extern void    *memalign(size_t, size_t);
  176. extern char    *mktemp(char *);
  177. extern int    mkstemp(char *);
  178. extern char    *ptsname(int);
  179. extern long    random(void);
  180. extern int    rand_r(unsigned int *);
  181. extern char    *realpath(const char *, char *);
  182. extern char    *setstate(char *);
  183. extern void    srandom(unsigned);
  184. extern long double    strtold(const char *, char **);
  185. extern void    swab(const void *, void *, ssize_t);
  186. extern char    *ttyname(int);
  187. extern int    ttyslot(void);
  188. extern int    unlockpt(int);
  189. extern void    *valloc(size_t);
  190. extern double    wcstod(const wchar_t *, wchar_t **);
  191. extern float    wcstof(const wchar_t *, wchar_t **);
  192. extern long    wcstol(const wchar_t *, wchar_t **, int);
  193. extern long double    wcstold(const wchar_t *, wchar_t **);
  194. extern unsigned long    wcstoul(const wchar_t *, wchar_t **, int);
  195.  
  196.  
  197.  
  198. extern double    drand48(void);
  199. extern double    erand48(unsigned short *);
  200. extern long    jrand48(unsigned short *);
  201. extern void    lcong48(unsigned short *);
  202. extern long    lrand48(void);
  203. extern long    mrand48(void);
  204. extern long    nrand48(unsigned short *);
  205. extern int    putenv(const char *);
  206. extern unsigned short    *seed48(unsigned short *);
  207. extern void    setkey(const char *);
  208. extern void    srand48(long);
  209.  
  210.  
  211.  
  212. #define mblen(s, n)    mbtowc((wchar_t *)0, s, n)
  213.  
  214. #ifdef __cplusplus
  215. }
  216. #endif
  217.  
  218. #pragma pack()
  219.  
  220. #endif /* _STDLIB_H */
  221. #endif
  222. #if defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__)
  223. #ifdef __cplusplus
  224. extern "C" {
  225. #endif
  226. extern int abs (int);
  227. #ifdef __cplusplus
  228. }
  229. #endif
  230. #endif /* defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__*/
  231.